package br.sc.senai.model.factory;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import br.sc.senai.model.dao.EntitiesDAO;
import br.sc.senai.model.entity.Automovel;

public class ControlerFacotry {

	private static final List<Class> listSingletonClass = loadSingletonClass();
	private static final HashMap<Type, Object> listInstanceClass = new HashMap<Type, Object>();
	
	private static List<Class> loadSingletonClass(){
		List<Class> mListClass = new ArrayList<Class>();
		mListClass.add(ControlerFacotry.class);
		mListClass.add(EntitiesDAO.class);
		
		return mListClass;
	}
	
	public static <T> T getInstanceOf(Class<T> pClass, Object... pParamsConstructor){
		try {
			if (listInstanceClass.get(pClass) != null) return (T) listInstanceClass.get(pClass);
			
			// TODO implementar criação do objeto com e sem parâmetros no construtor!
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}
}
